Unit BDojoObjectStoreUnit;

{$mode objfpc}{$H+}

Interface

Uses
  Classes, sysutils, BDojoSessionUnit, BDojoStoreUnit;

Type

{ BDojoObjectStoreClass }

//** A Dojo Data implementation that wraps Dojo object stores for backwards
//** compatibility.

 BDojoObjectStoreClass = Class(BDojoObjectClass)
  Private
    bObjectStore: BDojoStoreClass;
    Procedure SetObjectStore(aValue: BDojoStoreClass);
  Public
    Property ObjectStore: BDojoStoreClass Read bObjectStore
      Write SetObjectStore;
    Constructor Build(Const aSession: BDojoSessionClass;
      Const aJSType: String = ''); override;
End;

Implementation

{ BDojoObjectStoreClass }

Procedure BDojoObjectStoreClass.SetObjectStore(aValue: BDojoStoreClass);
Begin
  Associate(aValue);
  bObjectStore := aValue;
  SetConfig('objectStore', aValue);
End;

Constructor BDojoObjectStoreClass.Build(Const aSession: BDojoSessionClass;
  Const aJSType: String);
Begin
  If aJSType = '' Then Inherited Build(aSession, 'dojo.data.ObjectStore')
  Else Inherited Build(aSession, aJSType);
End;

End.

